home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_oilkey.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  85 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_OilKey.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16.  
  17. cog        talkCog                    local
  18.  
  19. sound    foundSnd=INXJ167.wav    local
  20.  
  21. thing    player                    local
  22.  
  23. int        bin=108                    local
  24.  
  25. end
  26.  
  27. # ===================================================================
  28.  
  29. code
  30.  
  31. activated:
  32.  
  33.     StartCutscene(0);
  34.  
  35.     talkCog = GetCogByIndex(0);
  36.     SendMessage(talkCog, 27);
  37.  
  38.     if (Rand() < 0.5)
  39.     {
  40.         SetExtCamOffset('0.15 -0.05 0.04');
  41.     }
  42.     else
  43.     {
  44.         SetExtCamOffset('-0.15 -0.05 0.04');
  45.     }
  46.     SetExtCamLookOffset('0.0 0.02 -0.01');
  47.  
  48.     return;
  49.  
  50. # -------------------------------------------------------------------
  51.  
  52. touched:
  53.  
  54.     player = GetSourceRef();
  55.  
  56.     if (GetInv(player, bin) < GetInvMax(player, bin))
  57.     {
  58.         TakeItem(GetSenderRef(), player);
  59.     }
  60.     else
  61.     {
  62.         EndCutscene();
  63.     }
  64.     
  65.     return;
  66.  
  67. # -------------------------------------------------------------------
  68.  
  69. taken:
  70.  
  71.     player = GetSourceRef();
  72.  
  73.     ChangeInv(player, bin, 1.0);
  74.     SetInvAvailable(player, bin, 1);
  75.     JonesInvItemChanged(bin);
  76.  
  77.     Sleep(1.0);
  78.     PlayVoice(player, foundSnd, 1.0, 0);
  79.  
  80.     EndCutscene();
  81.  
  82.     return;
  83.  
  84. end
  85.